<!doctype html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"
	/>
	<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
	<link rel="stylesheet" type="text/css" href="../css/aui.css" />
</head>

<body>
	<!--<header class="aui-bar aui-bar-nav" id="aui-header">
		<a class="aui-btn aui-pull-left" tapmode onclick="closeWin()">
	            <span class="aui-iconfont aui-icon-left"></span>
	        </a>
		<div class="aui-title">直播</div>
	</header>-->
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
	apiready = function () {
		api.parseTapmode();
		var headerPos = $api.offset($api.byId('aui-header'));
		if (api.pageParam.liveType === "图文直播") {
			api.openFrame({
				name: 'live_frm',
				url: './live_frm.html',
				bounces: false,
				rect: {
					x: 0,
					y: 0,
					w: 'auto',
					h: 'auto'
				},
				pageParam: {
					id: api.pageParam.id
				}
			});

			// api.openFrame({
			// 	name: 'live_msg_frm',
			// 	url: './live_msg_frm.html',
			// 	bounces: false,
			// 	rect: {
			// 		x: 0,
			// 		y: 500,
			// 		w: 'auto',
			// 		h: 100
			// 	},
			// 	pageParam: {
			// 		id: api.pageParam.id
			// 	}
			// });
		} else {
			var videoScreenHeight = api.winWidth * 9 / 16;
			//alert(videoScreenHeight);
			var video_player = api.require('playModule');
			//打开直播播放器
			video_player.init({
				buffering: "加载中...",
				fullBtnPlan: 1
			}, function () {
				video_player.play({
					rect: {
						x: 0,
						y: 0,
						w: api.winWidth,
						h: videoScreenHeight,
					},
					fixedOn: api.frameName,
					title: ' ',
					url: api.pageParam.pullStreamUrl,
					defaultBtn: true,
					enableFull: false,
					isTopView: false
				}, function (ret, err) {
					// alert(JSON.stringify(ret));
					console.log(JSON.stringify(ret));
				});
			});

			//打开图文直播列表
			api.openFrame({
				name: 'live_video_frm',
				url: 'live_video_frm.html',
				bounces: false,
				rect: {
					x: 0,
					y: videoScreenHeight,
					w: 'auto',
					h: 'auto'
				},
				pageParam: {
					id: api.pageParam.id
				}
			})
		}

	};

	function closeWin() {
		api.closeWin({
		});
	}

</script>

</html>